package com.daodway.designpattern.singletonpattern;

public class SingletonLazy {
	/*单例模式中所有对象公用属性*/
	private String name = null; 
	
	/*懒汉式创建单例*/  
	  private static SingletonLazy instance=null;
	  
	  private SingletonLazy(){}
	  
	  public static SingletonLazy getInstance() {
	      if(instance==null)
	    	  instance=new SingletonLazy();
	      return instance;
	  }
	  
	  
	  
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	  
	  
}
